@layout("/common/_curd/_container.html"){

<script type="text/javascript">
    var ctx = "${basePath}";
    var grid_selector = "#grid-table";
    var pager_selector = "#grid-pager";

    $(function(){
//        var userid = ""
//        var ajaxURL = "/buy/duizhangli";
//        $.post(ajaxURL,null,function (res) {
//            did = res.did
//            $('#did').val(did)
//            initGrid();
//        });
        initGrid();
        initMenuBtn("btns", "${code}");
    });

    function initGrid(){
        var grid_url = ctx + "/buy/duizhangli";
        var _colnames = ["",
            "填报时间",
            "数量",
            "供应商",
            "采购方",
            "商品",
//            "生产日期",
//            "生产批号",
//            "检测报告编号",
//            "检测报告图片",
            "删除",
            "追溯码"
        ];
        var _colmodel = [{name: "id", hidden: true, index: "id", width: 100},

            {name: "date", index: "date", width: 100},
            {name: "num", index: "num", width: 100},
            {name: "supname", index: "supname", width: 100},
            {name: "scname", index: "scname",  width: 100},
            {name: "pname", index: "pname", width: 100},
//            {name: "product_date", index: "product_date", width: 100},
//            {name: "product_code", index: "product_code", width: 100},
//            {name: "checks", index: "checks", hidden: true, width: 100},
//            {
//                name: "url", index: "url", hidden: true, width: 100, formatter: function (value, row, index) {
//                return '<image height="75px" width="100px" src="' + value + '"></image>';
//            }
//            },
            {
                name: "status", index: "status", width: 100,hidden:true, formatter: function (value, row, index) {
//                if(value === 1){
//                    return "已通过";
//                }else if(value === 2){
//                    return "未通过";
//                }else{
//                    return "未审核";
//                }
                return  '<a href="#" class="btn btn-btn btn-danger btn-xs"  onclick="deletes('+"'"+index.id+"'"+')">'+"删除"+'</a>' ;


            }
            },
            {name: "code", index: "code", hidden: true, width: 100}
        ];

        jQuery(grid_selector).jqGrid({
            url : grid_url,
            shrinkToFit : true,
            colNames : _colnames,
            colModel : _colmodel,
            jsonReader : {id :"id"},
            pager : pager_selector,
            postData : {sort : "id",
//				where:"{status:1,did:"+$('#did').val()+"}",
                status:4,
                schoolid:$('#schoolid').val(),
                suppid:$('#suppid').val(),
                order : "desc"}
        });
    }
</script>





<!-- 配置 grid -->
<input type="hidden" value="${schoolid}" id="schoolid">
<input type="hidden" value="${suppid}" id="suppid">
<input type="hidden" value="" id="did">
<div class="row">
    <div style="text-align: left;padding-left: 10px">
        <span style="font-size: 18px;color: red">合计：${count!}元</span>
        <!--<button href="#" class="btn btn-btn btn-success btn-xs" style="margin-left:20px;" onclick="duizhang()">确认无误</button>-->
    </div>

    <div class="col-xs-12 tb-grid">
        <!-- 配置 查询 -->
        <!-- 按钮 -->
        <!--<div class="welljq well-sm" id="btns"></div>-->
        <!-- grid -->
        <table id="grid-table"></table>
        <!-- 分页-->
        <div id="grid-pager"></div>
    </div>
</div>

<!-- 引入所需的js -->
@include("/common/_listscript.html"){}
@}